package com.xh.bussiness.teachbook.util;

import com.xh.core.util.OfficeUtils;

import java.io.InputStream;

/*
 * @Author daiwei
 * @Description
 * @Date 2019/5/10 17:16
 **/
public class TeachbookUtils {
    static {
        try {
            InputStream wordsLicense = OfficeUtils.class.getClassLoader().getResourceAsStream("aspose.words.license.xml");// 凭证文件
            InputStream slidesLicense =OfficeUtils.class.getClassLoader().getResourceAsStream("aspose.slides.license.xml");// 凭证文件
            InputStream cellsLicense = OfficeUtils.class.getClassLoader().getResourceAsStream("aspose.cells.license.xml");// 凭证文件

            com.aspose.slides.License slidesLic = new com.aspose.slides.License();
            slidesLic.setLicense(slidesLicense);
            com.aspose.words.License wordsLic = new com.aspose.words.License();
            wordsLic.setLicense(wordsLicense);
            com.aspose.cells.License cellsLic = new com.aspose.cells.License();
            cellsLic.setLicense(cellsLicense);

            //com.aspose.words.FontSettings.getDefaultInstance().setFontsFolder("/Users/david/Documents/Fonts", false);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
